package org.testis.utils;

import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;


/**
 *
 * @author nurhat
 */
public class JarUtils
{

    public static String getJarImplementationVersion(String jar)
        throws java.io.IOException
    {
        JarFile jarfile = new JarFile(jar);
        Manifest manifest = jarfile.getManifest();
        Attributes att = manifest.getMainAttributes();
        return att.getValue("Implementation-Version");
    }


    public static String getJarSpecificationVersion(String jar)
        throws java.io.IOException
    {
        JarFile jarfile = new JarFile(jar);
        Manifest manifest = jarfile.getManifest();
        Attributes att = manifest.getMainAttributes();
        return att.getValue("Specification-Version");
    }
}
